home *** CD-ROM | disk | FTP | other *** search
/ Your Choice 3 / Your Choice Software Collection 3.iso / prgmming / fsprite3 / dat2inc.pas < prev    next >
Pascal/Delphi Source File  |  1994-04-17  |  736b  |  25 lines

  1. VAR INFILE,OUTFILE:TEXT;
  2.     CONSTNUM:WORD;
  3.     INSTRING,SS,FNAME:STRING;
  4.     i:word;
  5. BEGIN
  6.      FNAME:=PARAMSTR(1);
  7.      ASSIGN(INFILE,FNAME+'.DAT');
  8.      ASSIGN(OUTFILE,FNAME+'.INC');
  9.      WRITELN('Creating ',FNAME,'.INC');
  10.      RESET(INFILE);
  11.      REWRITE(OUTFILE);
  12.      CONSTNUM:=0;
  13.      writeln(outfile,'CONST');
  14.      REPEAT
  15.            READLN(INFILE,INSTRING);
  16.            for i:=1 to length(instring) do instring[i]:=upcase(instring[i]);
  17.            INSTRING[0]:=CHR(POS('.',INSTRING)-1);
  18.            STR(CONSTNUM,SS);
  19.            WRITELN(OUTFILE,'    ',INSTRING+'='+SS+';');
  20.            WRITELN(instring:8,'=',SS);
  21.            INC(CONSTNUM);
  22.      UNTIL EOF(INFILE);
  23.      CLOSE(INFILE);
  24.      CLOSE(OUTFILE);
  25. END.